//
// Created by xujingyi on 2021/4/28.
//

#ifndef ALLIANCE_SENTRY_V2_0_OPTIONS_H
#define ALLIANCE_SENTRY_V2_0_OPTIONS_H

#define TEST_MODE //正式比赛时候注释调就好！！！
#define SHOOTER_MODE UP_SHOOTER
#define ASSISTED_FIRE
/*************** Define the SOLVE_MODE info ***************/
#define UP_SHOOTER 2
#define DOWN_SHOOTER 1

#define PNP_MODE 0
#define PIXEL_ANGLE_MODE 1
#define PIXEL_PREDICT_MODE 2
#define ANTI_PREDICT_MODE 3

#define PIXEL_MODE 0
#define COORD_MODE 1

#define CENTER_MODE 0
#define PART_MODE 1

#define ENEMY_RED 0
#define ENEMY_BLUE 1

#define EULAR_AXIS 1

/*************** Define the debug option ***************/
#ifdef DEBUG_MODE
#define DEBUG_WITH_CAMERA 1
#define LOG_LEVEL LOG_MSG
//#define SAVE_VIDEO_PATH PROJECT_DIR"/video/save/"
#define SOLVE_MODE 2 //PNP_MODE:0 PIXEL_ANGLE_MODE:1 PIXEL_PREDICT_MODE:2 ANTI_PREDICT_MODE:3
#define PRE_MODE 1 //PIXEL_MODE:0 COORD_MODE:1
#define GYRO_MODE 0 //CENTER_MODE:0 PART_MODE:1
#define SHOOT_ENGINEER 1 //0:not_shoot_engineer
#define LENET_NET_PATH PROJECT_DIR"/tools/equalize_lenet10.pb"
//#define SHOW_PARAM
//#define SHOW_SERIAL_INFO
//#define DEBUG
//#define TEST_THREAD
#endif

/*************** Define the major path ***************/
//#define Windows #使用VS时需要直接加在这里
//#define PATH "C:\\Users\\xjy_j\\source\\repos\\Project3\\Project3\\" windows用
#ifdef PATH
#define PROJECT_DIR PATH
#else
#define PROJECT_DIR "."
#endif // PATH

/*************** Define the run option ***************/
#ifndef DEBUG_MODE
#define LOG_LEVEL LOG_NONE
#define DEBUG_WITH_CAMERA 1
#define SOLVE_MODE 2 //PNP_MODE:0 PIXEL_ANGLE_MODE:1 PIXEL_PREDICT_MODE:2 ANTI_PREDICT_MODE:3
#define PRE_MODE 1 //PIXEL_MODE:0 COORD_MODE:1
#define GYRO_MODE 1 //CENTER_MODE:0 PART_MODE:1
#define SHOOT_ENGINEER 0 //0:not_shoot_engineer
#define SAVE_VIDEO_PATH PROJECT_DIR"/video/save/game/"
#define LENET_NET_PATH PROJECT_DIR"/tools/equalize_lenet10.pb"
#endif
//#define USE_PERSPECTIVE_TRANSFORM


/*************** Define the output path ***************/
#define SAVE_PICTURE_PATH PROJECT_DIR"/picture/"
#define INFO_OUT_PATH PROJECT_DIR"/tools/data"

/*************** Define the constants ***************/
#define MYEPS (0.000000000000001)

#define ALLY_BLUE ENEMY_RED
#define ALLY_RED ENEMY_BLUE

#define BIG_ARMOR_BOX_H 60
#define BIG_ARMOR_BOX_W 230
#define SMALL_ARMOR_BOX_H 60
#define SMALL_ARMOR_BOX_W 125

#define FOCUS 8

typedef float accuracy;

//视频裁剪尺寸
#define PICTURE_COL_NUM 1280
#define PICTURE_ROW_NUM 720

#define ANGLE_PER_RAD (180.0f/CV_PI)

#define FOCUS_PIXAL_8MM (1815.0f/8.0f)
#define FOCUS_PIXAL_6MM  (179.0f)

//#define YAW_ANGLE (360.0f/8192.0f)

#define RAIL_HEIGHT (1310) //up horizon
#define MAX_FONT_THICKNESS (4)
#define UP_RAIL_DIFF (285)
#define DOWN_RAIL_DIFF (-300)

#if SHOOTER_MODE==DOWN_SHOOTER
#define FOCUS_PIXAL  FOCUS_PIXAL_8MM
#define PARAM_PATH PROJECT_DIR"/others/down_para.yaml"
#define PITCH_HORIZON_ANGLE (67)//DOWN
//#define YAW_VERTICLE_ANGLE (0)//UP
#define YAW_VERTICLE_ANGLE (0)//UP
#define RAIL_DIFF DOWN_RAIL_DIFF
#define PITCH_ANGLE_PLUS (320.0f/340.0f)
#define YAW_ANGLE_PLUS (900.0f/930.0f)
#define IMAGE_CENTER_X (631-(1280-PICTURE_COL_NUM)/2) //u0-coef.x coef is caused by cameraExtract/videoExtract
#define IMAGE_CENTER_Y (494-(1024-PICTURE_ROW_NUM)/2) //v0-coef.y
#else
#define FOCUS_PIXAL  FOCUS_PIXAL_8MM
#define PARAM_PATH PROJECT_DIR"/others/up_para.yaml"
#define YAW_VERTICLE_ANGLE (0)//UP
#define PITCH_HORIZON_ANGLE (450)//UP
#define PITCH_ANGLE_PLUS (240.0f/120.0f)
#define YAW_ANGLE_PLUS (900.0f/450.0f)
#define RAIL_DIFF UP_RAIL_DIFF
#define IMAGE_CENTER_X (600-(1280-PICTURE_COL_NUM)/2) //u0-coef.x coef is caused by cameraExtract/videoExtract
#define IMAGE_CENTER_Y (508-(1024-PICTURE_ROW_NUM)/2) //v0-coef.y
#endif
#define COLOR_WHITE cv::Scalar(255,255,255)
#define COLOR_YELLOW cv::Scalar(0,255,255)
#define COLOR_LIGHTYELLOW cv::Scalar(128,255,255)
#define COLOR_BLUE cv::Scalar(255,0,0)
#define COLOR_SKYBLUE cv::Scalar(230,216,173)
#define COLOR_GREEN cv::Scalar(0,255,0)
#define COLOR_LIGHTGREEN cv::Scalar(144,238,144)
#define COLOR_DARKCYAN cv::Scalar(139,139,0)
#define COLOR_RED cv::Scalar(0,0,255)
#define COLOR_PINK cv::Scalar(125,100,255)
#define COLOR_ORANGE cv::Scalar(0,125,255)
#define COLOR_PURPLE cv::Scalar(128,0,128)
#define COLOR_VIOLET cv::Scalar(238,130,238)
#define COLOR_CHOCOLATE cv::Scalar(30,105,210)
#define COLOR_OLIVE cv::Scalar(0,128,128)

#endif //ALLIANCE_SENTRY_V2_0_OPTIONS_H
